﻿<!DOCTYPE html
  PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="X-UA-Compatible" content="IE=EDGE;IE=11;IE=8,chrome=1" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>工装工具库存统计查询</title>
    <link href="/InSiteWebApplication/Content/Easyui/themes/metro/easyui.css" rel="stylesheet" />
    <link href="/InSiteWebApplication/Content/Easyui/custom-easyui.css" rel="stylesheet" />
    <link href="/InSiteWebApplication/Content/Easyui/themes/icon.css" rel="stylesheet" />
    <style>
        .easyui-linkbutton{margin-left:20px;}
        table tr td{padding:0px 5px}
        .Btitle{background-color: #ddd; padding: 10px; margin: 5px 10px;}
    </style>
</head>
<body>
    <div class="panelSection">    
        <div class="easyui-panel " title="查询区域" style="padding:3px;width:100%" data-options="closable:false,collapsible:true,minimizable:false,maximizable:false"> 
           <form id="searchForm" method="post">
	    	<table>
	    		<tr class="divLabel">
                    <td>工装工具图号:</td>
                    <td>工装工具名称:</td>
	    		</tr>
	    		<tr>
	    			<td><input  name="Factory" class="easyui-textbox" style="width: 120px; height: 22px" /></td>
	    			<td><input  name="WorkCenter" class="easyui-textbox" style="width: 120px; height: 22px" /></td>
                    <td> <span style="margin-right: 5px;"><input class="easyui-radiobutton" labelWidth="80px" labelPosition="after" name="IsKeyFeatures" value="1" label="只显示正常"/></span>
                            <input class="easyui-radiobutton" labelWidth="80px" labelPosition="after" name="IsKeyFeatures" value="0" label="只显示异常" checked="true"/>
                     </td>
                    <td><a href="javascript:void(0)" class="easyui-linkbutton" onclick="page.searchData()">查询</a></td>
	    			<td><a href="javascript:void(0)" class="easyui-linkbutton" onclick="page.searchReset()">重置</a></td>
	    		</tr>
	    	</table>
	    </form>
        </div> 
    </div>

    <div class="panelSection">    
      <div class="easyui-panel " title="工装工具库存统计" style="padding:3px;width:100%" data-options="closable:false,collapsible:true,minimizable:false,maximizable:false"> 
        <table id="ToolsStoreCensus" style="height:440px;width:100%" data-options="rownumbers:true"></table>
        <div id="pp" style="float: right" class="easyui-pagination" data-options="   
                 layout:['first','prev','next','last','manual','info'],              
                    total: 0,
                    showPageList: false,
                    showPageInfo: false,
                    showRefresh: false,
                    afterPageText:'共&nbsp{pages}&nbsp页',
                     buttons:[{
                            iconCls:'',
                            text:'Go',
                            id:'pageGo'
                    }]
                ">
                    </div>
        </div>
      </div>
</body>
</html>
<script src="/InSiteWebApplication/Scripts/json2.js" type="text/javascript"></script>
<script src="/InSiteWebApplication/Content/Easyui/jquery.min.js" type="text/javascript"></script>
<script src="/InSiteWebApplication/Content/Easyui/jquery.easyui.min.js" type="text/javascript"></script>
<script src="/InSiteWebApplication/Content/Easyui/easyui-lang-zh_CN.js" type="text/javascript"></script>
<script src="/InSiteWebApplication/Scripts/CustomPageJs/CustomCommon.js" type="text/javascript"></script>
<script>
//创建人：longb
//日期：2022-07-22
//描述：工装工具库存统计查询
var page = {
    pagetotal: 0,
    pageSize: 20,
    pageNumber: 1,
    index: null,
    rootPath: getRootPath(), //网站根路径
    ajaxUrl: getRootPath() + "/Ashx/ZsHandler/ZSSendRequestHandler.ashx",
    //初始化页面
    init: function () {
        page.bind();
        customizedEasyuiPagination('pp'); //定制化分页
    },
    //页面事件绑定
    bind: function () {
        $('#ToolsStoreCensus').datagrid({
            checkOnSelect: true,
            selectOnCheck: false,
            singleSelect: true,
            rownumbers: true,
            onLoadSuccess: function (data) {
                $('#pp').pagination('refresh', {	// 改变选项，并刷新分页栏信息
                    total: page.pagetotal,
                    pageSize: page.pageSize,
                    pageNumber: page.pageNumber
                });
                customizedEasyuiPagination('pp'); //定制化分页
            },
            columns: [[
              // { field: 'ck', title: '选择', checkbox: true },
                 { field: 'MFGORDERNAME', title: '工装工具图号', width: 140 },
		         { field: 'CONTAINERNO', title: '工装工具名称', width: 140 },
                 { field: 'PRODUCTNAME', title: '型号规格', width: 90 },
                 { field: 'DESCRIPTION', title: '工装工具类型', width: 100 },
                 { field: 'QTY', title: '安全库存量', width: 80 },
		         { field: 'ORDERTYPENAME', title: '最小库存量', width: 90, align: 'center' },
                 { field: 'ATTRIBUTEVALUE', title: '当前库存量', width: 100 },
                 { field: 'PRODUCTFAMILYNAME', title: '当前使用数量', width: 90 },
                 { field: 'PLANNEDSTARTDATE', title: '当前送检数量', width: 130 },
                 { field: 'PLANNEDCOMPLETIONDATE', title: '采购在途数量', width: 130 },
                 { field: 'FACTORYMONTH', title: '请制在制数量', width: 100 },
                 { field: 'FACTORYSTARDATE', title: '库存状态', width: 130 }
                ]]
        });
        //分页事件
        $('#pp').pagination({
            onSelectPage: function (pageNumber, pageSize) {
                customizedEasyuiPagination('pp'); //定制化分页
                page.pageSize = pageSize; page.pageNumber = pageNumber;
                page.GetToolsStoreCensus();
            }
        });
        //绑定分页go按钮
        $('#pageGo').on("click", function () {
            var pageNumber = $(this).parents('tr').find('.pagination-num').val();
            page.pageNumber = pageNumber;
            page.GetToolsStoreCensus();
        });
        //清除按钮
        $('#btnReset').on("click", function () {
            page.reset(true, true);
            page.pageNumber = 1; page.pagetotal = 0
            $('#pp').pagination('refresh', {
                total: page.pagetotal,
                pageSize: page.pageSize,
                pageNumber: page.pageNumber
            });
        });
    },
    //查询
    searchData: function () {
        clearMessage();
        page.pageNumber = 1;
        page.GetToolsStoreCensus();
    },
    //查询重置
    searchReset: function () {
        $('#searchForm').form('clear');
        clearMessage();
    },
    //查询任务单信息
    GetToolsStoreCensus: function () {
        var frdata = $('#searchForm').serializeArray();
        var data = {};
        $.each(frdata, function () {
            data[this.name] = this.value
        });
        var param = {
            action: "GetToolsStoreCensus",
            pageSize: page.pageSize,
            pageNumber: page.pageNumber,
            data: JSON.stringify([data])
        };
        page.post(param, function (res) {
            page.pagetotal = res.RowCount;
            $('#ToolsStoreCensus').datagrid('loadData', res.DBTable);
        });
    },
    //清除方法，重要！！！
    reset: function (iscondition, isresult) {
        clearMessage();
    },
    //post数据
    post: function (param, callback) {
        $.ajax({
            type: "Post",
            url: page.ajaxUrl,
            data: param,
            cashe: false,
            async: true,
            dataType: "json",
            beforeSend: function () {
                $.messager.progress({ text: '', msg: '处理中...' });
            },
            success: function (data) {
                $.messager.progress('close');
                callback(data);
            },
            error: function (XMLHttpRequest, textStatus, errorThrown) {
                $.messager.progress('close');
                displayMessage(XMLHttpRequest.responseText, false);
            }
        });
    }
}
$(function () {
    page.init();
});
</script>
